package com.example.topicservice.dao;

import com.example.commonapi.pojo.UAT;
import com.example.commonapi.pojo.Topic;
import com.example.commonapi.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface TopicDao {
    Integer addTopic(Topic topic);

    int deleteTopic(Topic topic);

    Integer deleteTopicById(int id);

    Topic getTopicById(@Param("id") int id);

//    获取所有Topic
    List<Topic> totalTopic();

    List<Topic> getTopicByUserId(Integer userId);

    /**
     * 获取 user_and_topic 视图的所有数据
     * @return
     */
    List<UAT> getAllUAT();

    List<UAT> search(String word);

    List<UAT> getUATByUserId(Integer userId);

    User getUserByTopicId(Integer topicId);

    void topicUpdate(Topic topic);

    void deleteTopicByUserId(Integer userId);
}
